# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Roman Kyrylych <roman@archlinux.org>
# Contributor: Roman Kyrylych <roman@archlinux.org>

pkgname=visitors
pkgver=0.7
pkgrel=7
pkgdesc='A very fast web log analyzer'
arch=('loong64' 'x86_64')
url="http://www.hping.org/visitors/"
license=('GPL2' 'custom')
depends=('glibc')
optdepends=('perl: for iis2apache.pl')
source=(http://www.hping.org/visitors/$pkgname-$pkgver.tar.gz ldflags.patch)
sha512sums=('41902a44d802b7318e0a2aec7b2947ca478cac94c97e071fefbae0ba67fe74d2985e7c27bdc64d8789d41ab46586a0478cc8f4b6ed83cb6a32139799cb328a11'
            '898c3bac8f558d537fa673d1e2556882440dc2783444d01c1dbf5a2dac9c82e06b208cf6d60d4d867166b224716eb5195dbfe19b2e4a35ffa297375efd43b62e')

prepare() {
  cd "$srcdir"/${pkgname}_${pkgver}
  patch -Np1 -i ${srcdir}/ldflags.patch
}

build() {
  cd "$srcdir"/${pkgname}_${pkgver}
  make
}

package() {
  cd "$srcdir"/${pkgname}_${pkgver}
  install -D visitors "$pkgdir"/usr/bin/visitors
  install -D iis2apache.pl "$pkgdir"/usr/bin/iis2apache.pl
  gzip visitors.1
  install -Dm644 visitors.1.gz "$pkgdir"/usr/share/man/man1/visitors.1.gz
  install -Dm644 COPYING "$pkgdir"/usr/share/licenses/visitors/COPYING
}
